package com.starlink.common.log.configuration;

import com.starlink.common.log.UserInfoFunction;
import com.starlink.common.log.interceptor.UserInfoHandlerInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author: lichao
 * @date: 2021-06-21 13:49:04
 */

public class CommonWebConfiguration implements WebMvcConfigurer {
    @Autowired
    private UserInfoFunction userInfoFunction;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new UserInfoHandlerInterceptor(userInfoFunction));
    }

}
